package com.d0326;

import java.util.Set;
import java.util.TreeSet;
//顺序
public class TestTreeSet {
    public static void main(String[] args) {
        Set<Student> treeSet = new TreeSet<>();
        Student stu1 = new Student("Jack",21,98);
        Student stu2 = new Student("Jack1",22,97);
        Student stu3 = new Student("Jack2",20,99);
        Student stu4 = new Student("Jack3",23,96);

        treeSet.add(stu1);
//        treeSet.add(stu2);
//        treeSet.add(stu3);
//        treeSet.add(stu4);
        System.out.println("个数是"+treeSet.size());

        for (Student i :
                treeSet) {
            System.out.println(i);
        }

    }
}
